<?php
namespace Assist\Controller;

class NewController extends  AssistController{
    public function index(){
        $date = date('Ymd');
        $exist = false;
        try {
            $obd = M('beat_rescheck_'.$date, 'zb_n900_', 'mysql://czm:chudird@icarforce.mysql.rds.aliyuncs.com/n900');
            $obdid = $obd->distinct(true)->field('obdid')->select();
	    foreach ($obdid as $value) {
		$map['obdid'] = array('eq', $value['obdid']);
		$curtime[$value['obdid']] = $obd->where($map)->max('curtime');
	    }
	    $this->assign('curtime', $curtime);
            $exist = true;
            $this->assign('exist', $exist);
	    var_dump($curtime);
           // $this->display();
        } catch (\Exception $ex) {
            $this->assign('exist', $exist);
            $this->display();
        }
        
    }
}
